package inabit.inabitcompiler.parser;

import inabit.compiler.parser.grammar.Grammar;
import inabit.inabitcompiler.lexical.InabitTokenClass;
import inabit.inabitcompiler.productions.constant.C1_Rule;
import inabit.inabitcompiler.productions.constant.C1_Rule2;
import inabit.inabitcompiler.productions.constant.C_Rule;
import inabit.inabitcompiler.productions.constant.Const_Rule;
import inabit.inabitcompiler.productions.constant.Const_Rule2;
import inabit.inabitcompiler.productions.fuzzy.Fs1_Rule;
import inabit.inabitcompiler.productions.fuzzy.Fs1_Rule2;
import inabit.inabitcompiler.productions.fuzzy.Fs2_Rule;
import inabit.inabitcompiler.productions.fuzzy.Fs2_Rule2;
import inabit.inabitcompiler.productions.fuzzy.Fs_Rule;
import inabit.inabitcompiler.productions.fuzzy.Fs_Rule2;
import inabit.inabitcompiler.productions.rule.R1_Rule;
import inabit.inabitcompiler.productions.rule.R1_Rule2;
import inabit.inabitcompiler.productions.rule.R_Rule;
import inabit.inabitcompiler.productions.rule.Rule_Rule;
import inabit.inabitcompiler.productions.rule.Rule_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.E_Rule;
import inabit.inabitcompiler.productions.rule.expressions.K1_Rule;
import inabit.inabitcompiler.productions.rule.expressions.K1_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.K_Rule;
import inabit.inabitcompiler.productions.rule.expressions.K_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.K_Rule3;
import inabit.inabitcompiler.productions.rule.expressions.M1_Rule;
import inabit.inabitcompiler.productions.rule.expressions.M1_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.M_Rule;
import inabit.inabitcompiler.productions.rule.expressions.O_Rule;
import inabit.inabitcompiler.productions.rule.expressions.O_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.O_Rule3;
import inabit.inabitcompiler.productions.rule.expressions.O_Rule4;
import inabit.inabitcompiler.productions.rule.expressions.O_Rule5;
import inabit.inabitcompiler.productions.rule.expressions.RestRule2;
import inabit.inabitcompiler.productions.rule.expressions.Rest_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.A_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.F1_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.F1_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.F1_Rule3;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.F_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.X1_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.X1_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.X1_Rule3;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.X_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.Z1_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.Z1_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.Z_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.Z_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.Z_Rule3;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.Z_Rule4;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.Z_Rule5;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.method.A1_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.method.A1_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.method.J_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.method.J_Rule2;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.method.U_Rule;
import inabit.inabitcompiler.productions.rule.expressions.arithmetic.method.U_Rule2;
import inabit.inabitcompiler.productions.start.S_Rule;
import inabit.inabitcompiler.productions.values.G_Rule;
import inabit.inabitcompiler.productions.values.G_Rule2;
import inabit.inabitcompiler.productions.values.N_Rule;
import inabit.inabitcompiler.productions.values.N_Rule2;
import inabit.inabitcompiler.productions.values.N_Rule3;
import inabit.inabitcompiler.productions.variable.L1_Rule;
import inabit.inabitcompiler.productions.variable.L1_Rule2;
import inabit.inabitcompiler.productions.variable.L_Rule;
import inabit.inabitcompiler.productions.variable.V1_Rule;
import inabit.inabitcompiler.productions.variable.V1_Rule2;
import inabit.inabitcompiler.productions.variable.V_Rule;
import inabit.inabitcompiler.productions.variable.Var_Rule;
import inabit.inabitcompiler.productions.variable.types.D_Rule;
import inabit.inabitcompiler.productions.variable.types.D_Rule2;
import inabit.inabitcompiler.productions.variable.types.G1_Rule;
import inabit.inabitcompiler.productions.variable.types.G1_Rule2;
import inabit.inabitcompiler.productions.variable.types.P_Rule;
import inabit.inabitcompiler.productions.variable.types.T_Rule;
import inabit.inabitcompiler.productions.variable.types.T_Rule2;
import inabit.inabitcompiler.productions.variable.types.T_Rule3;

/**The context-free grammar of the rule language*/
/**@author Rafael Rocha*/
public class InabitGrammar {
	
	private InabitGrammar() {
		
	}
	
	/**builds the rule base grammar*/
	public static Grammar buildGrammar() {
		Grammar myGrammar = new Grammar();
		
		myGrammar.addTerminals(InabitTokenClass.values());
		
		myGrammar.addProductionRules(
				/*Start*/
				new S_Rule(),
				/*Values*/
				new N_Rule(), new N_Rule2(), new N_Rule3(),
				new G_Rule(), new G_Rule2(),
				/*Variables*/
				new Var_Rule(),
				new V1_Rule(), new V1_Rule2(),
				new V_Rule(),
				new D_Rule(), new D_Rule2(),
				new L_Rule(), 
				new L1_Rule(), new L1_Rule2(),
				new T_Rule(), new T_Rule2(), new T_Rule3(),
				new P_Rule(),
				new G1_Rule(), new G1_Rule2(),
				/*Constants*/
				new Const_Rule(), new Const_Rule2(),
				new C_Rule(),
				new C1_Rule(), new C1_Rule2(),
				/*Rules*/
				new Rule_Rule(), new Rule_Rule2(),
				new R1_Rule(), new R1_Rule2(),
				new R_Rule(),
				new E_Rule(),
				new M1_Rule(), new M1_Rule2(),
				new M_Rule(),
				new K1_Rule(), new K1_Rule2(),
				new K_Rule(), new K_Rule2(), new K_Rule3(),
				new Rest_Rule(), new RestRule2(),
				new O_Rule(), new O_Rule2(), new O_Rule3(), new O_Rule4(), new O_Rule5(),
				new A_Rule(),
				new X1_Rule(), new X1_Rule2(), new X1_Rule3(),
				new X_Rule(),
				new F1_Rule(), new F1_Rule2(), new F1_Rule3(),
				new F_Rule(),
				new Z1_Rule(), new Z1_Rule2(),
				new Z_Rule(), new Z_Rule2(), new Z_Rule3(), new Z_Rule4(), new Z_Rule5(),
				new J_Rule(), new J_Rule2(),
				new U_Rule(), new U_Rule2(),
				new A1_Rule(), new A1_Rule2(),
				/*Fuzzy*/
				new Fs_Rule(), new Fs_Rule2(),
				new Fs1_Rule(), new Fs1_Rule2(),
				new Fs2_Rule(), new Fs2_Rule2());
		
		myGrammar.setInitialSymbol("S");
		
		myGrammar.setEOF(InabitTokenClass.EOF);
		return myGrammar;
	}
}
